/**
 * @program school-bus-cloud
 * @description: SbCode
 * @author: mf
 * @create: 2020/10/31 15:38
 */

package com.eye.catcher.constants;

/**
 * @author huzhiwei
 * @since 2022-02-08
 */
public enum SbCode {

    //
    PHYSICAL_BORROW_TYPE_BORROW("1","已借阅"),
    PHYSICAL_BORROW_TYPE_RETURN("2","已归还"),
    PHYSICAL_BORROW_TYPE_LOSE("3","已丢失"),
    PHYSICAL_BORROW_TYPE_OUTBOUND("4","已出库"),

    //
    FILE_DATA_ENTITY("1","实体"),
    FILE_DATA_ELECTRONIC("2","电子"),
    FILE_DATA_ENTITY_AND_ELECTRONIC("3","实体和电子"),
    //
    BORROW_PROCESS_STATUS_STAGING("1","待提交"),
    BORROW_PROCESS_STATUS_AUDIT("2","流程发起,流转中"),
    BORROW_PROCESS_STATUS_BORROW("3","已完成"),
    BORROW_PROCESS_STATUS_NOT_RETURN("4","待归还"),
    BORROW_PROCESS_STATUS_RETURN("5","已归还"),
    BORROW_PROCESS_STATUS_OUTBOUND("6","已出库"),
    BORROW_PROCESS_STATUS_LOSE("7","已丢失"),
    BORROW_PROCESS_STATUS_REJECTED("8","被驳回"),
    BORROW_PROCESS_STATUS_TERMINATION("9","已终止"),
    BORROW_PROCESS_STATUS_REPEATED("10","重复借阅"),
    //
    ORGANIZE_MANAGER_ORGPROPSENIORMANAGER("ORGPROPSENIORMANAGER","部门负责人"),
    ORGANIZE_MANAGER_ORGANIZEHEAD("ORGANIZEHEAD","部门分管领导"),

    //流程审核状态
    PROCESS_AUDIT_TYPE_START("START","发起"),
    PROCESS_AUDIT_TYPE_PASS("PASS","通过"),
    PROCESS_AUDIT_TYPE_REJECT("REJECT","驳回"),
    PROCESS_AUDIT_TYPE_TERMINATION("TERMINATION","终止"),
    PROCESS_AUDIT_TYPE_END("END","结束"),

    //流程引擎 配置类型
    PROCESS_NODE_AUDIT_TYPE_USER("1","人"),
    PROCESS_NODE_AUDIT_TYPE_ROLE("2","角色"),
    PROCESS_NODE_AUDIT_TYPE_ORG("3","部门"),
    PROCESS_NODE_AUDIT_TYPE_ORGPROPSENIORMANAGER("4","提交人得部门负责人"),
    PROCESS_NODE_AUDIT_TYPE_ORGANIZEHEAD("5","提交人的部门分管领导"),

    //getUserInfoById  type
    GETUSERINFOBYID_TYPE_All("1","全查"),
    GETUSERINFOBYID_TYPE_NOT_MODULE("2","不查模块"),
    GETUSERINFOBYID_TYPE_ONLAY_MODULE("3","只查模块"),

    //文件状态
    DATA_FILE_NONE("0","待移交"),
    DATA_FILE_INITIATE("1","已移交"),
    DATA_FILE_NOT_RECEIVE("2","待接收"),
    DATA_FILE_RECEIVE("3","已接收"),
    DATA_FILE_ARCHIVE("4","已归档"),
    DATA_FILE_SHELVES("5","已上架"),
    //移交状态
    TURNOVER_NONE("0","未移交"),
    TURNOVER_INITIATE("1","已移交"),
    TURNOVER_FINISH("2","已接收"),
    TURNOVER_BACK("3","已退回"),

    DATA_TYPE_TYPE1("1","纯目录"),
    DATA_TYPE_TYPE2("2","关联资料"),
    //
    DATA_TOP_PARENT_ID("-1","顶级目录父级id"),
    //数据来源
    DATA_SOURCE_CREATE("XTCJ","系统创建"),
    DATA_SOURCE_IMPORT("MBDR","模板导入"),
    DATA_SOURCE_SYNCHRONOUS("JKTB","接口同步"),
    //数据状态
    DATA_NORMAL("1","正常"),
    DATA_DISABLE("0","禁用"),
    //默认
    DATA_DEFAULT_NOT("0","不默认"),
    DATA_DEFAULT_IS("1","默认"),

    //数据新增状态
    DATA_ONLY_ADD("1","只新增"),
    DATA_DELETE_AFTER_ADD("2","删除后新增"),
    //微服务系统编码
    LANXUM_SYSTEM("LANXUM_SYSTEM","系统管理"),
    LANXUM_LOG("LANXUM_LOG","日志管理"),
    LANXUM_AUTH("LANXUM_AUTH","身份验证"),
    LANXUM_GATEWAY("LANXUM_GATEWAY","路由网关"),

    //操作编码
    OPERATION_ADD("OPERATION_ADD","新增"),
    OPERATION_EDIT("OPERATION_EDIT","修改"),
    OPERATION_DELETE("OPERATION_DELETE","删除"),
    OPERATION_QUERY("OPERATION_QUERY","查询"),
    OPERATION_UPLOAD("OPERATION_UPLOAD","上传"),
    OPERATION_PREVIEW("OPERATION_PREVIEW","预览"),
    OPERATION_DOWLOAD("OPERATION_DOWLOAD","下载"),
    OPERATION_OTHER("OPERATION_OTHER","其他"),
    OPERATION_LOGIN("OPERATION_LOGIN","登录"),
    OPERATION_SCHEDULE("OPERATION_LOGIN","定时器操作"),
    OPERATION_PROCESS("OPERATION_PROCESS","审核流程"),
    OPERATION_ARCHIVE("OPERATION_ARCHIVE","归档操作"),
    OPERATION_BORROW("OPERATION_BORROW","借阅操作"),
    OPERATION_BORROW_RETURN("OPERATION_BORROW_RETURN","借阅归还操作"),

    // 系统公用
    SUCCESS("000000", "成功"),
    CREATE_CATALOG_ERRROR("002001", "创建目录操作失败"),
    TURNOVER_ERRROR("002002", "移交操作失败"),
    ARCHIVE_ERRROR("002003", "归档操作失败"),
    ARCHIVE_UNDO_ERRROR("002004", "归档撤销操作失败"),
    BORROW_ERRROR("002005", "借阅操作失败"),
    USERORPASSWORD_ERRROR("003001", "用户名或密码不正确"),
    TOKEN_VALID_FAILED("003002", "token校验失败"),
    USERNAME_ALREADY_EXISTS("003003", "用户名已存在"),
    USER_REGISTER_FAILED("003004", "注册失败，请联系管理员"),
    KAPTCHA_CODE_ERROR("003005", "验证码不正确"),
    USER_ISVERFIED_ERROR("003006", "用户名尚未激活"),
    USER_REGISTER_VERIFY_FAILED("003007", "用户注册失败插入验证数据失败"),
    USER_INFOR_INVALID("003008", "用户信息不合法"),
    USERNAME_ALREADY_NO_EXISTS("003009", "用户名不存在"),

    REQUEST_FORMAT_ILLEGAL("003060", "请求数据格式非法"),
    REQUEST_IP_ILLEGAL("003061", "请求IP非法"),
    REQUEST_CHECK_FAILURE("003062", "请求数据校验失败"),
    DATA_NOT_EXIST("003070", "数据不存在"),
    DATA_REPEATED("003071", "数据重复"),
    REQUEST_DATA_NOT_EXIST("003072", "传入对象不能为空"),
    REQUEST_DATA_ERROR("003074", "必要的参数不正确"),
    REQUISITE_PARAMETER_NOT_EXIST("003073", "必要的参数不能为空"),
    PERMISSION_DENIED("003091", "权限不足"),
    DB_EXCEPTION("003097", "数据库异常"),
    SYSTEM_TIMEOUT("003098", "系统超时"),
    SYSTEM_ERROR("003099", "系统错误"),
    UPLOAD_FILE_REPEAT("003100", "请勿重复上传"),
    UPLOAD_FILE_NO_EXCEPTION("003101", "分片序号异常"),

    USERVERIFY_INFOR_INVALID("003200", "用户注册验证验证信息不合法"),

    FLOW_ERROR("005001", "已限流，请稍后再试哦"),
    DEGRADE_ERROR("005002", "已降级，请稍后再试哦"),
    PARAMFLOW_ERROR("005003", "已参数限流，请稍后再试哦"),
    SYSTEMBLOCK_ERROR("005004", "系统规则，请稍后再试哦"),
    AUTHORITY_ERROR("005005", "认证限流，请稍后再试哦");

    private String code;
    private String message;

    SbCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * Getter method for property <tt>code</tt>.
     *
     * @return property value of code
     */
    public String getCode() {
        return code;
    }

    /**
     * Setter method for property <tt>code</tt>.
     *
     * @param code value to be assigned to property code
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * Getter method for property <tt>message</tt>.
     *
     * @return property value of message
     */
    public String getMessage() {
        return message;
    }

    /**
     * Setter method for property <tt>message</tt>.
     *
     * @param message value to be assigned to property message
     */
    public void setMessage(String message) {
        this.message = message;
    }

    public static String getMessage(String code) {
        for (SbCode s : SbCode.values()) {
            if (null == code)
                break;
            if (s.code.equals(code)) {
                return s.message;
            }
        }
        return null;
    }
}

